package com.jia.lidao.others.adapter;

import android.content.Context;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.jia.lidao.R;
import com.jia.lidao.others.enity.Channels;

/**
 * Created by 00029935 on 2017/12/6.
 */

public class ChoosePayWayAdapter extends QuickAdapter<Channels.PaymentChannelsBean> {
    private Context context;

    public ChoosePayWayAdapter(Context context) {
        this.context = context;
    }

    @Override
    public int getLayoutID(int viewType) {
        return R.layout.choose_pay_way_adapter_item;
    }

    @Override
    public void convert(VH holder, Channels.PaymentChannelsBean itemData, int position) {
        ImageView ivPic = holder.getView(R.id.iv_pic);
        Glide.with(context).load(itemData.getIcon()).error(R.mipmap.pay_alipay).into(ivPic);
        TextView tvName = holder.getView(R.id.tv_name);
        tvName.setText(itemData.getName());

        CheckBox cbox = holder.getView(R.id.cb_box_ali);
        cbox.setChecked(itemData.isChecked);
    }
}
